/*
 * Rectangle.h
 *
 *      Author: Jerome RD Soine and Christoph A Brand
 *      Institution: Schwarz goup, Institute for Theoretical Physics, Heidelberg University, Germany
 */

#ifndef RECTANGLE_H_
#define RECTANGLE_H_

#include <vector>
#include "Shape.h"

using namespace std;

/*!
 *  \brief Rectangular shape object class
 */


class Rectangle : public Shape
{
public:
	/*!
	 * Creates a rectangular shape object based on center position, orientation angle, and edge lengths.
	 */
	Rectangle(vector<double> CENTER, double ORIENTATION_ANGLE, double A, double B)
	{center = CENTER; orientation_angle=ORIENTATION_ANGLE; a = A; b=B;};

	bool is_on_shape(vector<double> point);
	double get_area() {return a*b;};
	vector<double> get_center() {return center;};
	static vector<Shape*> get_shapes_from_file(string FILENAME);
	double get_orientation_angle(){return orientation_angle;};

protected:
	vector<double> rotate(vector<double> &point, double angle);
	static double flip_orientation(double angle);

	vector<double> center;
	double orientation_angle;
	double a;
	double b;

};


#endif /* RECTANGLE_H_ */
